<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"          			
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core"
      >
    <ui:composition template="TaskProLayout.xhtml">
        <ui:define name="content"> 
              <h:form id="userForm">   
                  <div class="Post">
            <p:dataTable widgetVar="userTable" var="student" value="#{userBean.students}"
                         selection="#{userBean.selectedUser}" selectionMode="single"
                         rowKey="#{student.id}"
                         styleClass="facesFont" id="userTable">             
                <f:facet name="header">  
                    <h:outputText value="Students in system" />
                </f:facet>    
                <p:column headerText="Login">                
                    <h:outputText value="#{student.login}" />  
                </p:column>   
                <p:column headerText="Name">  
                    <h:outputText value="#{student.name}"></h:outputText>
                </p:column>  
                <p:column headerText="Surname">   
                    <h:outputText value="#{student.surname}"></h:outputText>
                </p:column>
                <p:column>  
                    <f:facet name="header">  
                        <h:outputText value="E-mail"/>
                    </f:facet>  
                    <h:outputText value="#{student.email}"></h:outputText>
                </p:column>
            </p:dataTable> 
                  </div>
                  <div class="Post">
           <p:commandButton value="Delete User" update=":userForm:userTable" action="#{userBean.removeUser()}" ajax="false" />
            <p:commandButton value="Modify User" action="modifyUserAdmin" ajax="false"/>  
                  </div>
              </h:form>
</ui:define>
    </ui:composition>
</html>